The JPEG system based on the conventional technology which is a standard system for compressing still images employed in an image processing apparatus for a digital camera or the like is a compression system for encoding with variable length, and for this reason in some object a generated code rate obtained after compression may vary.
On the other hand, as an object image compression system for an image processing apparatus for a digital camera or the like, it is required to inform an operator of the number of sheets of object image which can be photographed with a remaining memory space by displaying it or the like, so that it is necessary to carry out processing for encoding into a fixed length target file to reduce a memory space used for a piece of object image, namely a generated code rate for a sheet of object image to a prespecified value or less.
As described above, in a case where the JPEG is employed for the image processing apparatus for a digital camera or the like, in the JPEG, object image data is subjected to two-dimensional DCT (Discrete Cosine Transform) by each block unit comprising 8.times.8 pixels to transform it to a DCT coefficient which is a frequency element. Quantized data with this DCT coefficient weighted weights to the low frequency element is transformed to Huffman code by means Huffman encoding, which is encoding with variable length. The Huffman encoding is executed in a block on the previous screen and a finally generated code rate is computed.
In a case where the finally generated code rate exceeds the prespecified rate described above, the number of sheets of object image which can be photographed varies. On the other hand, if the finally generated code rate is too small, the number of sheets of image which can be photographed with a remaining memory space does not become different from the estimated number of sheets of image, but the image quality of the object image becomes excessively lower.
To solve the problem described above, processing for encoding into a fixed length target file for equalizing a finally generated code rate to a prespecified rate is carried out. As a method of encoding into a fixed length target file, there is a method in which an entire screen is compressed over a plurality of times by changing a scale factor value "Q" for uniformly dividing image data to obtain a different quantization table or a coefficient of the quantization table and by computing an optimal control coefficient by repeating the compression processing until the generated code rate enters the range of the prespecified rate (e.g. "Image processing apparatus" disclosed in Japanese Patent Laid-Open Publication No. HEI 4-233373).
As another way of processing for encoding into a fixed length target file, there is a method of providing a plurality of encoding devices for subjecting inputted object image data to different processing for encoding and selecting an optimal result from encoded results provided by the encoding devices respectively (e.g. "Image processing apparatus" disclosed in Japanese Patent Laid-Open Publication No. HEI 4-87472).
However, among the methods of processing for encoding into a fixed length target file based on the conventional technology, especially in the method of processing for encoding into a fixed length target file executed with the former image processing apparatus, it takes an extremely and disadvantageously long period of time to execute compression processing for many times by changing a control coefficient to the entire image screen.
Also, the method of processing for encoding with fixed length target file executed by the latter image processing apparatus, provision of a plurality of encoding devices increases cost of the entire devices although a time required for processing for encoding can be reduced.